Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is it possible to use dual function for a dimension?
Thank you in advance,
Larisa
Syntax for dual() is dual(text, number).
In your calculated dimension,
=dual(Only(Media), Медиа)
both fields are showing only text values.´
Besides this, the only() function seems a bit strange here. Are you looking for
=aggr( Only(Media), Медиа)
?
Yes it is. Dimension is only a way a field is used. A field could be used both as a dimension and in a regular expression for a measure. So any field can have all, some or none of its values as dual. The dual is a function to create a dual value. There are no restrictions on the usage of a field with dual values.
Hi,
Could you say why the dual function doesn't work correctly as a dimension in my example?
see the file attached.
Thank you in advance
Syntax for dual() is dual(text, number).
In your calculated dimension,
=dual(Only(Media), Медиа)
both fields are showing only text values.´
Besides this, the only() function seems a bit strange here. Are you looking for
=aggr( Only(Media), Медиа)
?
The Dual function will not work as you try to assign two text values. Dual assigns one text value and one numeric value as the compound data value within a field.
Thus you can use Медиа directly without the need for a numeric value. Dimensions does not need to be numeric. They can be pure text/alphanumeric values without a number associated with them. However you could assign a number to be associated with each text value and that will also determine the sort order of the field. But the text-part will what will be displayed in most of the UI.
In you example I would modify the load script to this:
LOAD
Dual( Медиа , RecNo() ) AS Медиа,
Dual( Media , RecNo() ) AS Media,
Quantity
INLINE [
Медиа, Media, Quantity
ТВ, TV, 8
Радио, Radio, 10
Пресса, Press, 4
];
Then you could use either Медиа or Media as a dimension without employing the Dual function as that has already been done in your load script. You could of course also assign directly a number for each media instead of using RecNo() as I did.
Thank you!
thank you!
Sir !
Please short the second dimension alphabetically.