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: 
Daniel77
Creator
Creator

Data different with same expression in measure and dimension

Hi All,

 

I have the following Expression.

if([Standard Name] <>'Oeko Tex',[Standard Name],
If([Standard Name] ='Oeko Tex' and followupexpiry = Aggr(Max(followupexpiry),[Production Facility T1],certified_product, [Standard Name]),[Standard Name],null()))

When i add this to a measure i get the desired result (col 2) but when I add the same to a Dimension i get all null, even though there is no error.

 

Just noticed in the header it looks like one is reading as a number and the other text

Daniel77_0-1700064818735.png

 

I need the result as column 2 but as a dimension so i can hide the nulls. I tried the add ons and unticked show zero value but this had no impact on the table.

 

Can anyone let me know why the measure is treating the expression differently to the dimension and how the required can be achieved?

 

Thank you

 

 

 

Labels (2)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

For the Dimension you will need to wrap the expression in an Aggr() to tell Qlik what field to run the expression over. 

Aggr(
if([Standard Name] <>'Oeko Tex',[Standard Name],
If([Standard Name] ='Oeko Tex' and followupexpiry = Aggr(Max(followupexpiry),[Production Facility T1],certified_product, [Standard Name]),[Standard Name],null()))
[Standard Name])

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

For the Dimension you will need to wrap the expression in an Aggr() to tell Qlik what field to run the expression over. 

Aggr(
if([Standard Name] <>'Oeko Tex',[Standard Name],
If([Standard Name] ='Oeko Tex' and followupexpiry = Aggr(Max(followupexpiry),[Production Facility T1],certified_product, [Standard Name]),[Standard Name],null()))
[Standard Name])

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

Daniel77
Creator
Creator
Author

Thanks so much for the help, this worked perfectly.

Have a great weekend.

 

Daniel