Skip to content

Instantly share code, notes, and snippets.

@gsbeaton
Last active May 5, 2017 11:09
Show Gist options
  • Save gsbeaton/6c6519c22896b702d59bc357a5e9438c to your computer and use it in GitHub Desktop.
Save gsbeaton/6c6519c22896b702d59bc357a5e9438c to your computer and use it in GitHub Desktop.
Use these variables to help create a flexible report object.
// Self Service Report Helper
SET vActivateReportMeasure = If(Index(Concat(MeasureFieldName,';'),SubField(concat(MeasureFieldName,';'),';',$1)) AND GetSelectedCount(MeasureLabel),1,0);
SET vMeasureFieldName      = SubField(concat(MeasureFieldName,';'),';',$1);
SET vMeasureLabel          = Only({<MeasureFieldName={"~(=SubField(concat(MeasureFieldName,';'),';',$1))"}>} MeasureLabel);
LET vMeasureLabel          = Replace(vMeasureLabel,'~','$');  //I wish QlikView had an escape character!
//usage:
//$(vActivateReportMeasure(1))
//=$(vMeasureLabel(1))
//$(=$(vMeasureFieldName(1)))
SET vActivateReportDim     = If(Index(Concat(ReportFieldName,';'),SubField(concat(ReportFieldName,';'),';',$1)) AND GetSelectedCount(ReportLabel),1,0);
SET vReportFieldName       = '['&SubField(concat(ReportFieldName,';'),';',$1)&']';
SET vReportLabel           = Only({<ReportFieldName={"~(=SubField(concat(ReportFieldName,';'),';',$1))"}>} ReportLabel);
LET vReportLabel           = Replace(vReportLabel,'~','$');  //I wish QlikView had an escape character!
//usage:
//=$(=$(vReportFieldName(1)))
//$(vActivateReportDim(1))
//=$(vReportLabel(1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment