Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i want sum of values
i have
compaNY NAME | AMOUNT |
---|---|
ABC | 10 |
BTY | 20 |
ATE | 10 |
ZYS | 50 |
I WANT THE SUM ON ABC BTY AND ATE WHICH IS 40 IN A BAR
THE FOLLOWING CODE:
Sum({$<COMPANY_NAME = {"A*","B*"}>}AMOUNT)
in bar chart but i am getting all the bar of company name starting from a and b
thanks in advance
Dimension : =if(WildMatch(compaNYNAME,'A*','B*'),'AB','C to Z')
measure : Sum(AMOUNT)
Hi,
You can resolve this in multiple ways... one of them could be as below
You can create a new field say New Company Name in back end, and merge all three values in one value
eg. If(wildmatch(CompanyName, 'ABC', 'BTY', 'ATE'), NewName, CompanyName) as NewCompanyName.
then use NewCompanyName field in the chart as dimension.
I am not sure what is the issue when you use this?
Sum({$<COMPANY_NAME = {"A*","B*"}>}AMOUNT)
Can you elaborate on the problem?
When I copied your table directly with the formula, I got the same results.
However, I realized that I had mistyped the dimension (e.g. COMPANY NAME vs. COMPANY_NAME)
It is case sensitive - have you checked that?
Way I checked that was to Sum({<COMPANY_NAME = {"ABC"}>} AMOUNT) and when it did not yield 10, I went back and checked the dimension.
Hi,
Try this way.
Data:
LOAD *, if(WildMatch(COMPANY_NAME,'A*','B*'),1,0) as Flag;
LOAD * INLINE [
COMPANY_NAME,AMOUNT
ABC,10
BTY,20
ATE,10
ZYS,50
];
actually i want only 2 bars in chart where there are sum of all values in a 1 bar starting with letter 'A' and 'B'
and the 2 bar with all the remaining like 'C', D........till Z
in my case it is still showing all the bars with there respective company name
Sorry for replying late as i was not so good.
Thanks
Sorry maybe my explanation was not so good i want only 2 bar where 1 bar have sum of values of company name starting with a nd b and the 2 bar has all the other company name
Dimension : =if(WildMatch(compaNYNAME,'A*','B*'),'AB','C to Z')
measure : Sum(AMOUNT)
Hi girishrainbow
Try like this with Bar chart.
Script:
Data:
LOAD *, if(WildMatch(COMPANY_NAME,'A*','B*'),1,0) as Flag;
LOAD * INLINE [
COMPANY_NAME,AMOUNT
ABC,10
BTY,20
ATE,10
ZYS,50
];
1. Do not select dimension.
2. Company AB expression:
3. Company Others expression:
4.Output
Thanks this worked for me i did not what to change much in script as i little new changing in script looks a difficult task for me although i know i will have to learn it if i want to be in this