Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
aditya_pratap
Contributor III
Contributor III

Measure in Measure

Hi Everyone,@Michael_Tarallo @mbj @petter @richbyard @Mp3Leaks @rohitk1609 @Marcus_Spitzmiller @ergustafsson @Masaki_Hamano @Sue_Macaluso 

Good Evening,

I am using a measure in my app: sum({<week_of_year{"$(=max(week_of_year))"}>}total<week_of_year,gl_description>rtu_gv)

In this measure week_of_year is a columns which give us week number and rtu_gv is a column that we are having numerical values.

in this measure i am giving only one condition that is where week_of_year=max(week_of_year) but i have to add two more condition in this measure and here are condition:

((sum([rtu_gv])/sum([total_gvs]))>.10),

([spb_flag]='non-spb')

please help me in this i am not able to write i am getting expression error.

i want total of rtu_gv with these three conditions.
Thanks 

Aditya

3 Replies
marcus_sommer

You need probably something like this:

if(sum([rtu_gv]) /
    sum([total_gvs])> .10),
    sum({<week_of_year{"$(=max(week_of_year))"},
                [spb_flag]={'non-spb'}>} total<week_of_year,gl_description> rtu_gv))

You might be needing to include the condition and the totals also to your division-parts, too.

- Marcus

 

aditya_pratap
Contributor III
Contributor III
Author

in this measure i am getting values issue somewhere less and some where high
if((sum([rtu_gv])/sum([total_gvs])> .10),
if([spb_flag]={'non-spb'},
sum({<reporting_week_of_year={"$(=max(reporting_week_of_year))"}>}total<reporting_week_of_year,gl_description> rtu_gv)))

in this measure what is a error , i am getting an error as u can see in photo

aditya_pratap_0-1665507093251.png

 

marcus_sommer

The second if-loop is syntactically not correct. Try it with the following adjustment:

if((sum([rtu_gv]) / sum([total_gvs])> .10) and [spb_flag] = 'non-spb',
sum({<reporting_week_of_year={"$(=max(reporting_week_of_year))"}>} total <reporting_week_of_year,gl_description> rtu_gv))

- Marcus