Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

"Set Analysis With Parameters" as a Definition in Inline

I am Dynamically displaying Expressions/ Measures in Charts based on User Selection thru Subfield Feature and an  Inline table with one of the column holding the definition of the expression.

The Problem what I am facing here is when I try to use the Set Analysis with Multiple parameters as part of the expression definition, in inline table load script, it is not working, throwing error . But when I use the same definition outside the inline table and in the chart it works fine.

This problem happens only for the Set Analysis with multiple parameters. Set Analysis with single parameters works fine.

The Set Analysis definition which I am using in the Inline table is

 

Measures:
LOAD * INLINE [
OrderID, Measures,MeasureEquation
1, NPV, Sum( { <PeriodId= {"<=$(=max(PeriodID))>=$(=($(=Max(PeriodID))-2))"}, [Run Date] = > } NPV)

]

in the above, if add the parameter [Run Date] = , it is not accepting, other parameter being accepted.

Please help me to fix this issue

5 Replies
johnca
Specialist
Specialist

Does it need to be inline? I couldn't get it to work either (due to the comma and dollar signs) but when I put it into an external file I did.

LOAD OrderID,

     Measures,

     MeasureEquation & Chr(44) & SecondPart as FullEquation

FROM

[Thread284103.csv]

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

Where the csv file is:

OrderID, Measures,MeasureEquation, Second

1, NPV, Sum( { <PeriodId= {"<=$(=max(PeriodID))>=$(=($(=Max(PeriodID))-2))"}, [Run Date] = > } NPV)

Edit: BTW, I didn't bother with the extra "$(" and ")" in the greater than half of your expression...but it should probably be something like: PeriodId= {"<=$(=max(PeriodID))>=$(=Max(PeriodID)-2)"}

vishsaggi
Champion III
Champion III

May be try this?

= Sum({< PeriodId = {" $(= '>='&Max(PeriodID)-2&'<='Max(PeriodID))"}, [Run Date]= >} NPV)

Anonymous
Not applicable
Author

Thanks John Cavoulas. I have used CSV Option to resolve my issue.

I too tried with using Variable in the Inline statement, but it didn't work either way. Don't know why.

Thanks for pointing out extra "$(" and ")". I have removed those and used corrected expression in the CSV

Anonymous
Not applicable
Author

Please mark the discussion as "answered Correct". I am not getting that option in the Actions

johnca
Specialist
Specialist

It doesn't appear to me either. It was clearly marked as a question as it shows "Not Answered" in bold red. I'm logged so that's not it either.

Anyway, glad it helped.

The other possible solution will still break though in as much as it has an additional comma in it.

V/r,

John