Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
How i can create an expression to define a Column Title based in a conditional.
Sample that i have tryed, but without success:
CROSSTABLE ([Brand], [Quantity], 2)
LOAD
F1 as PRODUCT,
BRAND1,
BRAND2,
IF(PRODUCT="TLB", BRAND3, OTHERS)
FROM....
Thanks for any reply
Danilo
Danilo,
Please try this...
IF(PRODUCT='TLB', 'BRAND3', 'OTHERS') AS PRODUCT
Cheers - DV
D V,
Thanks for your reply, but not is this...
Look my complete code...if you see any problem, please tell-me.
ps.: without conditional, loads run =/
[FlashAux]:
CROSSTABLE([Brand], [Quantity],2)
LOAD
F1 AS [Product],
makedate($(ano),$(mes)) AS [Date],
[BRAD 1],
BRAND2,
IF(Product='TLB','BRAND3', 'OTHERS') as Product,
BRAND4,
BRAND5,
BRAND6,
BRAND7,
BRAND8,
BRAND9,
OTHERS
FROM [Flash Market\Flash$(var).xls]...
Tks
Danilo
What is the error message? Instead of Product, have you tried using F1 in the function condition. I mean you can't use the alias name with the same load script.
Cheers - DV
DV,
as you have oriented, i need use F1 instead of Product.
But another problem was appeared.
The field was loaded into different table. For it should have been loaded at Brands along with Brand4, 5 and so on, but was loaded in Quantity.
What to do?
Thanks again
Danilo,
I think what you want to do is change your If statement to: IF(F1 = 'TLB','BRAND3','OTHERS') as Brand3.
F1 has yet to be renamed to Product when your if statement executes so you need to reference it as it is in the excel file.
Now, does Brand1-9 exist as fields in the xls file?
Is it possible for you to share the QV document?
Cheers - DV
I think Leonard is right. figures crossed that should resolve the issue.
Cheers - DV
Unfortunally i can't share the QV file, because not is mine..
But the problem now, is:
My conditional was filling the table Quantity insteat of Brand.
I tryed change this:
CROSSTABLE
([Brand], [Quantity],2)
to
------
CROSSTABLE(if([Brand]='BRAND3' and [Product]='TLB', 'BRAND3','OTHERS'), [Quantity],2)
Tks again
-----
Could you provide a better layout of your source data at least for us? Also, what end result are you trying to achieve? What is the purpose of having each Brand in its own column within the source data? Could that be better accomplished in the chart itself?