Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II

Dimension of type dual

Hello
I'm preparing a dimension in the script as follows:

ali_hijazi_0-1701951806298.png

when I use it in a pivot table I'm not getting the descriptions, but the number values
how to display text value of this dimension?

ali_hijazi_1-1701951911180.png

 

I can walk on water when it freezes
Labels (1)
2 Solutions

Accepted Solutions
Or
MVP

I think this happens when the numeric aspect of your dual field includes nulls. I'd suggest replacing the null with e.g. Dual(Null(),-999) which should then use the text portion.

View solution in original post

vincent_ardiet_
Specialist

Try to replace the Null() expression below with Dual(Null(),-999) like suggested

vincent_ardiet__0-1701962711655.png



View solution in original post

9 Replies
Or
MVP

I think this happens when the numeric aspect of your dual field includes nulls. I'd suggest replacing the null with e.g. Dual(Null(),-999) which should then use the text portion.

ali_hijazi
Partner - Master II
Author

hello
there are no rows with null values
the if else cover all possible cases

I can walk on water when it freezes
Or
MVP

Your screen capture is clearly showing that there is a null, and there's clearly a null() at the end of your outermost if() statement..?

vincent_ardiet_
Specialist

@Or  is right, this is due to your NULL value, and more precisely, to the fact that this value is the first one encountered by the script when loading the data.

If you are doing something like this:
testtable:
Load dual('test',1) as test autogenerate 1;
Load null() as test autogenerate 1;
[test] will be displayed with the label.

If you are doing this:
testtable:
Load null() as test autogenerate 1;
Load dual('test',1) as test autogenerate 1;
[test] will be displayed as a number.

So use the trick given by @Or or sort your data.



ali_hijazi
Partner - Master II
Author

My expression is something like:
sum(

{

<condition1>
+
<condition2>
}
field
)
condition 1 returns all that do not have values
condition 2 returns all that have values
under condition 2 no records have null for this dimension

I can walk on water when it freezes
Or
MVP

And yet your screen capture is clearly showing that the dimension has null values...

Or_0-1701962250167.png

 

 

ali_hijazi
Partner - Master II
Author

yeah but not in the script
but the result of the expression

 

I can walk on water when it freezes
Or
MVP

Sorry, I'm afraid one of us isn't understanding what the other is saying...

If you've tried my suggestion and it didn't work, then perhaps you need to supply more information and/or a sample app demonstrating the issue.

vincent_ardiet_
Specialist

Try to replace the Null() expression below with Dual(Null(),-999) like suggested

vincent_ardiet__0-1701962711655.png