Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I'm trying to solve a problem. I've a report for salesmanager and my customer is asking me to see in a table as default a total amount of sales for 'black hats', and ask two switch fields where he can select all Type (to sum also shoes and gloves) and another independent switch where select all Colours. When he deletes his selection he wants to be back to his default report for "black hats".
TableA:
LOAD * INLINE [
Product, Type, Colour Amount
ProdA, Hat ,black, 100
ProdB, Hat, black, 200
ProdC, Hat, black, 200
ProdD, Hat, white, 50
ProdE, Hat, black, 200
ProdF, Shoes, black, 300
ProdG, Gloves, pink, 70
];
LOAD * INLINE [
Switch Type
Yes
];
LOAD * INLINE [
Switch Colour
Yes
];
Thank you in advance!
Hi,
The attached example should help. Note I had to use start ('*') instead of blank ('') for the all option.
Regards,
Jonathan
Hi,
I'd set up two variables, SwitchType and SwitchColour, behind buttons, that would start as 'Black' and 'Hat' but when unclicked be set to an empty string state (''). You could of course change the text on the buttons to say 'All' when they are blank.
A set analysis could then say something like:
sum({$<Type={'=$(SwitchType)'},Colour={'=$(SwitchColour)'}>} Amount)
A bit crude, but would probably work.
Regards,
Jonathan
Thank you jon, i'm trying to follow your suggestion but i don't understand when you say to start as 'Black'...you suggest usign input box to predefine value? Since i've some troubles to consider 'all' when is empty. Thank you
Hi,
The attached example should help. Note I had to use start ('*') instead of blank ('') for the all option.
Regards,
Jonathan
Hi, jonbroughavone.
I suggest slightly modified expression:
=sum({$*$<Type={'$(SwitchType)'},Colour={'$(SwitchColour)'}>} Amount)
Eureka, thank you!!
Sorry why this difference? Thank you
The $*$<..> is an intersection of sets.
Try to select a particular type in a listbox. If you use $<..> expression it overrides your selection and the table will remain the same.
I think that the user also expects to see only thouse types and colors that are selected.